package cn.com.guage.dtm.design.pattern.singleton;

public class 单例模式_静态内部类式 {

    public static void main(String[] args) {
        StaticInnerClassSingleton staticInnerClassSingleton = StaticInnerClassSingleton.getInstance();
        staticInnerClassSingleton.showMessage();
    }
}
class StaticInnerClassSingleton{
     private static class Holder {
        private static StaticInnerClassSingleton instance = new StaticInnerClassSingleton();
    }
    public static StaticInnerClassSingleton getInstance() {
        return Holder.instance;
    }
    public void showMessage() {
        System.out.println("单例模式_静态内部类式");
    }
}
